#include<iostream>
using namespace std;
int main() {
	int a, num = 1, x = 1;
	string b;
	cin >> a;
	cin >> b;
	if (a == 1)
		cout << b << "\n" << "0";
	else
	{
		while (num < a) {
			num = num + 2 * (2 * x + 1);
			if (num < a) {
				x++;
			}
		}
		for (int i = 0; i < x; i++) {
			for (int j = 0; j < i; j++) {
				cout << " ";
			}
			for (int k = 0; k < 2 * (x - i) - 1; k++) {
				cout << b;
			}
			cout << "\n";
		}
		for (int i = 2; i <= x; i++) {
			for (int j = 0; j < x - i; j++) {
				cout << " ";
			}
			for (int k = 0; k < 2 * i - 1; k++) {
				cout << b;
			}
			cout << "\n";
		}
		cout << a - (num - 2 * (2 * x + 1));
	}
}